package xna.android;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public class Button extends Sprite
{
	public static List<Button> buttonList = new ArrayList<Button>();
	
	public static int selectedButton = 0;
	
	public static enum Colors { RED, GREEN, BLUE, YELLOW };
	
	public static int getSelectedButton() 
	{
		return selectedButton;
	}

	public static void setSelectedButton(int selectedButton) 
	{
		Button.selectedButton = selectedButton;
	}

	public Colors currentColor;
	
	public static void createButton(Bitmap texture, int x, int y, SoundManager sm, Colors currentColor)
	{
		Button button = new Button(texture, x, y, sm, currentColor);
		buttonList.add(button);
	}
	
	public Button(Bitmap texture, int x, int y, SoundManager sm, Colors currentColor)
	{
		super(texture, x, y, sm);
		this.currentColor = currentColor;
	}
	public void Update(long gameTime)
	{
		super.update(320, 480);
	}
	
	public void Draw(Canvas spriteBatch)
	{
		super.draw(spriteBatch);
	}

	public Colors getCurrentColor() {
		return currentColor;
	}

	public void setCurrentColor(Colors currentColor) {
		this.currentColor = currentColor;
	}
	
	public static List<Colors> Random()
	{
		List<Colors> randomList = new ArrayList<Colors>();
		
		randomList.add(Colors.RED);
		randomList.add(Colors.GREEN);
		randomList.add(Colors.BLUE);
		randomList.add(Colors.YELLOW);
		
		List<Colors> finalList = new ArrayList<Colors>();
		
		Colors color;
		
		Random random = new Random();
		
		int resultRandom;
		
		for (int i = 0; i < 3; i++)
		{
			resultRandom = random.nextInt(randomList.size());
		
			color = randomList.get(resultRandom);
			randomList.remove(resultRandom);
			finalList.add(color);
		}
		
		finalList.add(randomList.get(0));
		
		return finalList;
		
	}
	
	
	
}
